import { Http } from '@/common/api'

export const listUrl = '/srm/invoice/page'

/**
 * 新增发票
 * @param params
 * @return {*|Promise}
 */
export const apiPostAddInvoice = async (params) => Http.post('/srm/invoice/add', params)
/**
 * 编辑发票
 * @param params
 * @return {*|Promise}
 */
export const apiPutEditInvoice = async (params) => Http.put('/srm/invoice/update', params)
/**
 * 根据ID获取发票详情
 * @param id
 * @return {*|Promise}
 */
export const apiGetInvoice = async (id) => Http.get(`/srm/invoice/findById?id=${id}`)
/**
 * 根据ID删除发票
 * @param ids
 * @return {*|Promise}
 */
export const apiDeleteInvoice = async (ids) => Http.delete(`/srm/invoice/delete?id=${ids}`)
/**
 * 取消票
 * @param ids
 * @return {*|Promise}
 */
export const apiGetCancelInvoice = async (ids) => Http.get(`/srm/invoice/cancel?id=${ids}`)

/**
 * 退回发票
 * @param ids
 * @return {*|Promise}
 */
export const apiGetRejectInvoice = async (ids) => Http.get(`/srm/invoice/reject?id=${ids}`)

/**
 * 发送发票
 * @param ids
 * @return {*|Promise}
 */
export const apiGetPublishInvoice = async (ids) => Http.get(`/srm/invoice/publish?id=${ids}`)

/**
 * 确认发票
 * @param ids
 * @return {*|Promise}
 */
export const apiGetConfirmInvoice = async (ids) => Http.get(`/srm/invoice/confirm?id=${ids}`)

/**
 * 确认收票
 * @param ids
 * @return {*|Promise}
 */
export const apiGetCompleteInvoice = async (ids) => Http.get(`/srm/invoice/complete?id=${ids}`)

export const billsListUrl = '/srm/bill/page'
